#include "stdafx.h"
#include "View.h"


View::View( Model * const inModel ) : mpModel( inModel ) , muLastTick( 0 ) , muFrameCount( 0 ) , mfFPS( 0.0f )
{

}

View::~View(void)
{
}

Model * const View::getModel() const
{
	return this->mpModel;
}

float View::doFPSCheck()
{
	unsigned int tick = GetTickCount();
	if( this->muLastTick == 0 )
	{
		this->muLastTick = tick;
	}

	if( tick / 1000 != this->muLastTick / 1000 )
	{
		this->mfFPS = float( this->muFrameCount );
		this->muFrameCount = 0;
	}
	else
	{
		this->muFrameCount ++;
	}

	this->muLastTick = tick;

	return this->mfFPS;
}